extends Node2D


'''
FIGHT = 0, 	## 战斗房间
REWARD = 1,	## 奖励房间
STORE = 2,	## 商店
BOSS = 3,	## BOSS
HOME = 4	## 玩家出生点

TOP = 0
RIGHT = 1
BOTTOM = 2
LEFT = 3
'''
var roomConfig = [
	{"type": 0, "position": Vector2(1, 0), "door": [3]},
	{"type": 0, "position": Vector2(0, 1), "door": [0]},
	{"type": 0, "position": Vector2(-1, 0), "door": [1]},
	{"type": 0, "position": Vector2(0, -1), "door": [2]}
]

func initMap(roomConfig):
	# 若没有子节点, 进入不了循环, 就不会再次调用初始化
	for index in len(roomConfig["children"]):
		initMap(roomConfig["children"][index])
